from rest_framework.throttling import SimpleRateThrottle

class VisitThrottle(SimpleRateThrottle):
    scope = 'AnonymousUser'

    def get_cache_key(self, request, view):
        return self.get_ident(request)


class UserThrottle(SimpleRateThrottle):
    scope = 'LoginUser'

    def get_cache_key(self, request, view):
        return request.user.user_id
